﻿#include "detection.h"
extern void setButtonStyle(QPushButton *pushButton, const QString &imageUrl1, const QString &imageUrl2);
extern int leftDockBabyred,leftDockBabygreen,leftDockBabyblue;
extern float leftDockBabytransparency;
DetectionButton::DetectionButton(QWidget *parent) :
    QPushButton(parent)
{
    detectionWidget = new QWidget(parent);
    detectionWidget->setStyleSheet(QString("background-color:rgba(%1,%2,%3,%4);").arg(leftDockBabyred).arg(leftDockBabygreen).arg(leftDockBabyblue).arg(leftDockBabytransparency));
    detectionWidget->setFixedSize(500,500);
    detectionWidget->move(140,0);

    triangleWidget = new TriangleWidget(detectionWidget);
    triangleWidget->setFixedSize(100,100);
    triangleWidget->move(0,360);
    triangleWidget->setVisible(true);
    layout=new QVBoxLayout(detectionWidget);
    layout2=new QHBoxLayout();
    layout3=new QVBoxLayout();

    layout->addLayout(layout2);
    layout->addLayout(layout3);

    detectionWidget->setLayout(layout);

    detectionbtn = new QPushButton(detectionWidget);
    detectionbtn->setFixedSize(50,50);

    controlDrone = new QPushButton(detectionWidget);
    controlDrone->setFixedSize(100,50);

    //layout2->addWidget(detectionbtn);
    layout2->addWidget(controlDrone);

    setButtonStyle(controlDrone,":/image/controlDrone",":/image/controlDrone2");
    setButtonStyle(detectionbtn,":/image/response1.png",":/image/response.png");

    detectionbtn->move(80,30);

}
